
  ___  ____  ____  ____  ____ (R)
 /__    /   ____/   /   ____/
___/   /   /___/   /   /___/   15.1   Copyright 1985-2017 StataCorp LLC
  Statistics/Data Analysis            StataCorp
                                      4905 Lakeway Drive
     MP - Parallel Edition            College Station, Texas 77845 USA
                                      800-STATA-PC        http://www.stata.com
                                      979-696-4600        stata@stata.com
                                      979-696-4601 (fax)

32-user 64-core Stata network perpetual license:
       Serial number:  501506200495
         Licensed to:  Harvard-MIT Data Center
                       Cambridge, MA

Notes:
      1.  Stata is running in batch mode.
      2.  Unicode is supported; see help unicode_advice.
      3.  More than 2 billion observations are allowed; see help obs_advice.
      4.  Maximum number of variables is set to 5000; see help set_maxvar.

. do "dofiles/13_Table_A9.do" 

. /****************************************************************************
> *****************************
> Replication Files for Housing Discrimination and the Toxics Exposure Gap in t
> he United States: 
> Evidence from the Rental Market  by Peter Christensen, Ignacio Sarmiento-Barb
> ieri and Christopher Timmins
> *****************************************************************************
> ****************************/
. 
. clear all

. set matsize 11000

. 
. use "../stores/toxic_discrimination_data.dta"

. 
. 
. keep if sample==1
(801 observations deleted)

. 
. loc quartiles 4

. set seed 1010101

. *****************************************************************************
> *******************
. * Prep data
. *****************************************************************************
> *******************
. gen computer=(person_or_computer==2)

. bys Address: egen computer_total=total(computer)

. 
. 
. 
. *****************************************************************************
> *******************
. * Minority
. *****************************************************************************
> *******************
. 
. 
. 
. eststo: disc_boot choice Minority_dec2 Minority_dec3 Minority_dec4 , varlist(
> i.gender i.education_level i.order)
note: multiple positive outcomes within groups encountered.
note: 1,331 groups (3,993 obs) dropped because of all positive or
      all negative outcomes.

Iteration 0:   log pseudolikelihood = -925.74055  
Iteration 1:   log pseudolikelihood = -916.48806  
Iteration 2:   log pseudolikelihood = -916.46513  
Iteration 3:   log pseudolikelihood = -916.46513  

Conditional (fixed-effects) logistic regression

                                                Number of obs     =      2,730
                                                Wald chi2(8)      =     120.56
                                                Prob > chi2       =     0.0000
Log pseudolikelihood = -916.46513               Pseudo R2         =     0.0833

                              (Std. Err. adjusted for 14 clusters in Zip_Code)
------------------------------------------------------------------------------
             |               Robust
      choice |      Coef.   Std. Err.      z    P>|z|     [90% Conf. Interval]
-------------+----------------------------------------------------------------
Minority_d~2 |  -.5211012   .1376313    -3.79   0.000    -.7474846   -.2947179
Minority_d~3 |  -.3482699   .1358951    -2.56   0.010    -.5717975   -.1247423
Minority_d~4 |   .1434486   .1312026     1.09   0.274    -.0723605    .3592577
             |
      gender |
       male  |  -.3129561   .0870571    -3.59   0.000    -.4561522     -.16976
             |
education_~l |
        low  |  -.1674876    .115987    -1.44   0.149    -.3582693     .023294
     medium  |  -.2999306   .1376423    -2.18   0.029    -.5263321   -.0735291
             |
       order |
          2  |  -.3356589   .2439099    -1.38   0.169     -.736855    .0655371
          3  |  -.9002829   .2019871    -4.46   0.000    -1.232522   -.5680438
------------------------------------------------------------------------------
cluster(Zip_Code)Zip_Codecluster(Zip_Code)Zip_Codecluster(Zip_Code)Zip_Code

Bootstrap Corrected Estimates
------------------------------------------------------------------------------
             |      Coef.   Std. Err.      t    P>|t|     [90% Conf. Interval]
-------------+----------------------------------------------------------------
Minority_d~2 |  -.5211012   .1554043    -3.35   0.005    -.7963119   -.2458906
Minority_d~3 |  -.3482699   .1367799    -2.55   0.024     -.590498   -.1060418
Minority_d~4 |   .1434486   .1396337     1.03   0.323    -.1038334    .3907307
------------------------------------------------------------------------------
(est1 stored)

. estimates store modelA1

. 
. preserve

. keep if computer_total==0 
(1,086 observations deleted)

. eststo: disc_boot choice Minority_dec2 Minority_dec3 Minority_dec4 , varlist(
> i.gender i.education_level i.order)
note: multiple positive outcomes within groups encountered.
note: 1,174 groups (3,522 obs) dropped because of all positive or
      all negative outcomes.

Iteration 0:   log pseudolikelihood = -706.32887  
Iteration 1:   log pseudolikelihood = -698.92037  
Iteration 2:   log pseudolikelihood = -698.89599  
Iteration 3:   log pseudolikelihood = -698.89599  

Conditional (fixed-effects) logistic regression

                                                Number of obs     =      2,115
                                                Wald chi2(8)      =      87.44
                                                Prob > chi2       =     0.0000
Log pseudolikelihood = -698.89599               Pseudo R2         =     0.0976

                              (Std. Err. adjusted for 14 clusters in Zip_Code)
------------------------------------------------------------------------------
             |               Robust
      choice |      Coef.   Std. Err.      z    P>|z|     [90% Conf. Interval]
-------------+----------------------------------------------------------------
Minority_d~2 |  -.6921464   .1523611    -4.54   0.000    -.9427581   -.4415346
Minority_d~3 |  -.5048451   .1595282    -3.16   0.002    -.7672457   -.2424445
Minority_d~4 |   .0500337   .1763205     0.28   0.777    -.2399876    .3400551
             |
      gender |
       male  |  -.4243665   .0979737    -4.33   0.000    -.5855189   -.2632141
             |
education_~l |
        low  |  -.2079791   .1336718    -1.56   0.120    -.4278497    .0118915
     medium  |  -.2514086   .1313048    -1.91   0.056    -.4673858   -.0354314
             |
       order |
          2  |  -.3374498   .2970432    -1.14   0.256    -.8260424    .1511429
          3  |  -.9078136   .1875325    -4.84   0.000    -1.216277     -.59935
------------------------------------------------------------------------------
cluster(Zip_Code)Zip_Codecluster(Zip_Code)Zip_Codecluster(Zip_Code)Zip_Code

Bootstrap Corrected Estimates
------------------------------------------------------------------------------
             |      Coef.   Std. Err.      t    P>|t|     [90% Conf. Interval]
-------------+----------------------------------------------------------------
Minority_d~2 |  -.6921464    .178033    -3.89   0.002    -1.007431   -.3768618
Minority_d~3 |  -.5048451   .1573207    -3.21   0.007    -.7834496   -.2262406
Minority_d~4 |   .0500337   .1800534     0.28   0.785    -.2688289    .3688964
------------------------------------------------------------------------------
(est2 stored)

. estimates store modelA2

. restore

. 
. *****************************************************************************
> *******************
. * African American vs Hispanic/LatinX
. *****************************************************************************
> *******************
. eststo: disc_boot choice  Black_dec2  Black_dec3 Black_dec4 Hispanic_dec2  Hi
> spanic_dec3 Hispanic_dec4  , varlist(i.gender i.education_level i.order)
note: multiple positive outcomes within groups encountered.
note: 1,331 groups (3,993 obs) dropped because of all positive or
      all negative outcomes.

Iteration 0:   log pseudolikelihood = -910.23067  
Iteration 1:   log pseudolikelihood = -899.77346  
Iteration 2:   log pseudolikelihood = -899.71428  
Iteration 3:   log pseudolikelihood = -899.71427  

Conditional (fixed-effects) logistic regression

                                                Number of obs     =      2,730
                                                Wald chi2(11)     =    1743.92
                                                Prob > chi2       =     0.0000
Log pseudolikelihood = -899.71427               Pseudo R2         =     0.1000

                              (Std. Err. adjusted for 14 clusters in Zip_Code)
------------------------------------------------------------------------------
             |               Robust
      choice |      Coef.   Std. Err.      z    P>|z|     [90% Conf. Interval]
-------------+----------------------------------------------------------------
  Black_dec2 |  -.8083192   .1492354    -5.42   0.000    -1.053789   -.5628489
  Black_dec3 |  -.6198705   .2013075    -3.08   0.002    -.9509919   -.2887491
  Black_dec4 |  -.0088093   .1651946    -0.05   0.957    -.2805303    .2629117
Hispanic_d~2 |  -.2521266    .134985    -1.87   0.062    -.4741571    -.030096
Hispanic_d~3 |  -.0790205   .0917728    -0.86   0.389    -.2299734    .0719324
Hispanic_d~4 |   .2938816   .1543903     1.90   0.057     .0399321    .5478311
             |
      gender |
       male  |  -.3068188   .0902902    -3.40   0.001     -.455333   -.1583047
             |
education_~l |
        low  |  -.2085472   .1269706    -1.64   0.100    -.4173952    .0003009
     medium  |  -.3217568   .1289106    -2.50   0.013    -.5337959   -.1097176
             |
       order |
          2  |  -.3274132   .2524973    -1.30   0.195    -.7427343    .0879078
          3  |  -.9038518   .2104678    -4.29   0.000    -1.250041    -.557663
------------------------------------------------------------------------------
cluster(Zip_Code)Zip_Codecluster(Zip_Code)Zip_Codecluster(Zip_Code)Zip_Codeclus
> ter(Zip_Code)Zip_Codecluster(Zip_Code)Zip_Codecluster(Zip_Code)Zip_Code

Bootstrap Corrected Estimates
------------------------------------------------------------------------------
             |      Coef.   Std. Err.      t    P>|t|     [90% Conf. Interval]
-------------+----------------------------------------------------------------
  Black_dec2 |  -.8083192   .1853143    -4.36   0.001    -1.136498   -.4801399
  Black_dec3 |  -.6198705   .1960878    -3.16   0.008     -.967129    -.272612
  Black_dec4 |  -.0088093   .1656711    -0.05   0.958    -.3022017    .2845831
Hispanic_d~2 |  -.2521266   .1399496    -1.80   0.095    -.4999679   -.0042852
Hispanic_d~3 |  -.0790205   .0933243    -0.85   0.412    -.2442917    .0862507
Hispanic_d~4 |   .2938816   .1755685     1.67   0.118    -.0170384    .6048017
------------------------------------------------------------------------------
(est3 stored)

. sum choice if White==1 

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      choice |      2,241    .3944668    .4888449          0          1

. estadd scalar responsewhite = r(mean), replace 

added scalar:
      e(responsewhite) =  .39446676

. estadd local gender = "Yes", replace 

added macro:
             e(gender) : "Yes"

. estadd local edu = "Yes", replace 

added macro:
                e(edu) : "Yes"

. estadd local order = "Yes", replace 

added macro:
              e(order) : "Yes"

. estimates store modelB1

. 
. preserve

. keep if computer_total==0 
(1,086 observations deleted)

. eststo: disc_boot  choice Black_dec2  Black_dec3 Black_dec4 Hispanic_dec2  Hi
> spanic_dec3 Hispanic_dec4  , varlist(i.gender i.education_level i.order)
note: multiple positive outcomes within groups encountered.
note: 1,174 groups (3,522 obs) dropped because of all positive or
      all negative outcomes.

Iteration 0:   log pseudolikelihood = -695.98872  
Iteration 1:   log pseudolikelihood = -687.76181  
Iteration 2:   log pseudolikelihood = -687.70352  
Iteration 3:   log pseudolikelihood = -687.70352  

Conditional (fixed-effects) logistic regression

                                                Number of obs     =      2,115
                                                Wald chi2(11)     =     250.71
                                                Prob > chi2       =     0.0000
Log pseudolikelihood = -687.70352               Pseudo R2         =     0.1121

                              (Std. Err. adjusted for 14 clusters in Zip_Code)
------------------------------------------------------------------------------
             |               Robust
      choice |      Coef.   Std. Err.      z    P>|z|     [90% Conf. Interval]
-------------+----------------------------------------------------------------
  Black_dec2 |  -.9421447   .1876089    -5.02   0.000    -1.250734   -.6335554
  Black_dec3 |  -.7331611     .24155    -3.04   0.002    -1.130476   -.3358467
  Black_dec4 |  -.1978579   .2137999    -0.93   0.355    -.5495275    .1538118
Hispanic_d~2 |  -.4662445   .1396843    -3.34   0.001    -.6960048   -.2364843
Hispanic_d~3 |  -.2869782   .1054037    -2.72   0.006    -.4603519   -.1136045
Hispanic_d~4 |   .2917432   .1819952     1.60   0.109    -.0076123    .5910987
             |
      gender |
       male  |  -.4297982   .0924643    -4.65   0.000    -.5818885   -.2777079
             |
education_~l |
        low  |  -.2534795   .1452087    -1.75   0.081    -.4923265   -.0146325
     medium  |  -.2661016   .1294332    -2.06   0.040    -.4790003   -.0532029
             |
       order |
          2  |  -.3378238   .3034465    -1.11   0.266    -.8369488    .1613012
          3  |  -.8979026   .1954692    -4.59   0.000    -1.219421   -.5763844
------------------------------------------------------------------------------
cluster(Zip_Code)Zip_Codecluster(Zip_Code)Zip_Codecluster(Zip_Code)Zip_Codeclus
> ter(Zip_Code)Zip_Codecluster(Zip_Code)Zip_Codecluster(Zip_Code)Zip_Code

Bootstrap Corrected Estimates
------------------------------------------------------------------------------
             |      Coef.   Std. Err.      t    P>|t|     [90% Conf. Interval]
-------------+----------------------------------------------------------------
  Black_dec2 |  -.9421447   .2314588    -4.07   0.001    -1.352043   -.5322465
  Black_dec3 |  -.7331611   .2292657    -3.20   0.007    -1.139175   -.3271468
  Black_dec4 |  -.1978579   .2115864    -0.94   0.367    -.5725633    .1768476
Hispanic_d~2 |  -.4662445   .1389196    -3.36   0.005     -.712262   -.2202271
Hispanic_d~3 |  -.2869782   .1073786    -2.67   0.019    -.4771385   -.0968179
Hispanic_d~4 |   .2917432   .2087201     1.40   0.186    -.0778863    .6613727
------------------------------------------------------------------------------
(est4 stored)

. sum choice if White==1 

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      choice |      1,879    .3390101    .4734993          0          1

. estadd scalar responsewhite = r(mean), replace 

added scalar:
      e(responsewhite) =  .33901011

. estadd local gender = "Yes", replace 

added macro:
             e(gender) : "Yes"

. estadd local edu = "Yes", replace 

added macro:
                e(edu) : "Yes"

. estadd local order = "Yes", replace 

added macro:
              e(order) : "Yes"

. estimates store modelB2

. restore

. 
. 
. 
. *****************************************************************************
> *******************
. * Export to latex
. * based on http://www.eyalfrank.com/code-riffs-stata-and-regression-tables/
. *****************************************************************************
> *******************
. 
. 
. 
. ************************************************************
. * estout Panel A
. ************************************************************
. 
. #delimit ; 
delimiter now ;
. esttab modelA1 
>        modelA2 
>        using "../views/tableA9.tex", 
>        style(tex) 
>        eform
>        cells(b(star fmt(4)) ci(par fmt(4) par(( , )))  )  
>        label 
>        noobs
>        mlabels(,none)  
>        nonumbers 
>        collabels(,none) 
>        eqlabels(,none)
>        varlabels(Minority_dec2 "Minority 0-25th perc. Toxic Concentration" 
>                                  Minority_dec3 "Minority 25-75th perc. Toxic 
> Concentration"  
>                                  Minority_dec4 "Minority 75-100th perc. Toxic
>  Concentration" ) 
>        starl(* 0.1 ** 0.05 *** 0.01)   
>        level(90)     
>        prehead(                                 
> \begin{table}[H]
> \scriptsize \centering
> \begin{threeparttable}
> \captionsetup{justification=centering}
>   \caption{Estimates of Discriminatory Constraint on Housing Choice \\ Hetero
> geneity by Response Origin: Human or Computer}
>   \label{tab:heterogeneitycomputer}
> 
> \begin{tabular}{@{\extracolsep{5pt}}lcc}
> \\[-1.8ex]\hline
> \hline \\[-1.8ex]
>  & \multicolumn{2}{c}{\textit{Dependent variable: {\it  Response}}} \\
>  \cline{2-3}
> 
> \\[-1.8ex] & Full Sample & Human-Generated Responses  \\
> \\[-1.8ex] & (1) & (2)  \\
> \hline \\[-1.8ex] 
>        )
>        posthead({\it Panel A.: Minority } \\
>                                 &  &    \\) 
>       prefoot() 
>        postfoot(
>       \hline \\[-1.8ex] )
>        
>        replace;
(output written to ../views/tableA9.tex)

. #delimit cr
delimiter now cr
. 
. 
. 
. ************************************************************
. * estout Panel B
. ************************************************************
. 
. #delimit ; 
delimiter now ;
. esttab modelB1 
>        modelB2 
>        using "../views/tableA9.tex", 
>        style(tex) 
>        eform
>        cells(b(star fmt(4)) ci(par fmt(4) par(( , )))  )  
>        label 
>        noobs
>        mlabels(,none)  
>        nonumbers
>        collabels(,none) 
>        eqlabels(,none)
>        varlabels(Black_dec2 "Af. American 0-25th perc. Toxic Concentration"
>                                 Black_dec3 "Af. American 25-75th perc. Toxic 
> Concentration"
>                                 Black_dec4 "Af. American 75-100th perc. Toxic
>  Concentration"
>                                 Hispanic_dec2 "Hispanic/LatinX 0-25th perc. T
> oxic Concentration"
>                                 Hispanic_dec3 "Hispanic/LatinX 25-75th perc. 
> Toxic Concentration"
>                                 Hispanic_dec4 "Hispanic/LatinX 75-100th perc.
>  Toxic Concentration") 
>        starl(* 0.1 ** 0.05 *** 0.01) 
>        stats(responsewhite
>              gender 
>              edu 
>              order
>              N
>              listings
>              diff_response, fmt(2 0 0 0 %9.0gc %9.0gc 2)
>              labels(" Mean Response (White)"
>                    "\hline Gender" 
>                    "Education Level" 
>                    "Inquiry Order"
>                    "\hline Observations"
>                    "Listings"
>                    "\% w. diff. response"
>                    )) 
>        level(90)     
>          prehead( 
>        )
>        posthead({\it Panel B: By Race }\\
>                                          &  &     \\) 
>       prefoot() 
>        postfoot(           
> \hline
> \hline \\[-1.8ex]
> \end{tabular}
> \begin{tablenotes}[scriptsize,flushleft] \scriptsize
> \item Notes:  
> \end{tablenotes} 
> \end{threeparttable}
> \end{table})
>        append;
(output written to ../views/tableA9.tex)

. #delimit cr
delimiter now cr
. 
. 
. 
. *end 
. 
. 
. *end
. 
end of do-file
